\(\int \sqrt {a+a \cos (c+d x)} \sec ^2(c+d x) \, dx\) [101]
Optimal result
Integrand size = 23, antiderivative size = 62 \[
\int \sqrt {a+a \cos (c+d x)} \sec ^2(c+d x) \, dx=\frac {\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right )}{d}+\frac {a \tan (c+d x)}{d \sqrt {a+a \cos (c+d x)}}
\]
[Out]
arctanh(sin(d*x+c)*a^(1/2)/(a+a*cos(d*x+c))^(1/2))*a^(1/2)/d+a*tan(d*x+c)/d/(a+a*cos(d*x+c))^(1/2)
Rubi [A] (verified)
Time = 0.14 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of
steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {2851, 2852, 212}
\[
\int \sqrt {a+a \cos (c+d x)} \sec ^2(c+d x) \, dx=\frac {\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a \cos (c+d x)+a}}\right )}{d}+\frac {a \tan (c+d x)}{d \sqrt {a \cos (c+d x)+a}}
\]
[In]
Int[Sqrt[a + a*Cos[c + d*x]]*Sec[c + d*x]^2,x]
[Out]
(Sqrt[a]*ArcTanh[(Sqrt[a]*Sin[c + d*x])/Sqrt[a + a*Cos[c + d*x]]])/d + (a*Tan[c + d*x])/(d*Sqrt[a + a*Cos[c +
d*x]])
Rule 212
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
/; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])
Rule 2851
Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp
[(b*c - a*d)*Cos[e + f*x]*((c + d*Sin[e + f*x])^(n + 1)/(f*(n + 1)*(c^2 - d^2)*Sqrt[a + b*Sin[e + f*x]])), x]
+ Dist[(2*n + 3)*((b*c - a*d)/(2*b*(n + 1)*(c^2 - d^2))), Int[Sqrt[a + b*Sin[e + f*x]]*(c + d*Sin[e + f*x])^(n
+ 1), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] &
& LtQ[n, -1] && NeQ[2*n + 3, 0] && IntegerQ[2*n]
Rule 2852
Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[-2*(
b/f), Subst[Int[1/(b*c + a*d - d*x^2), x], x, b*(Cos[e + f*x]/Sqrt[a + b*Sin[e + f*x]])], x] /; FreeQ[{a, b, c
, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
Rubi steps \begin{align*}
\text {integral}& = \frac {a \tan (c+d x)}{d \sqrt {a+a \cos (c+d x)}}+\frac {1}{2} \int \sqrt {a+a \cos (c+d x)} \sec (c+d x) \, dx \\ & = \frac {a \tan (c+d x)}{d \sqrt {a+a \cos (c+d x)}}-\frac {a \text {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,-\frac {a \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right )}{d} \\ & = \frac {\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right )}{d}+\frac {a \tan (c+d x)}{d \sqrt {a+a \cos (c+d x)}} \\
\end{align*}
Mathematica [A] (verified)
Time = 0.07 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.27
\[
\int \sqrt {a+a \cos (c+d x)} \sec ^2(c+d x) \, dx=\frac {\sqrt {a (1+\cos (c+d x))} \sec \left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) \left (\sqrt {2} \text {arctanh}\left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right ) \cos (c+d x)+2 \sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}
\]
[In]
Integrate[Sqrt[a + a*Cos[c + d*x]]*Sec[c + d*x]^2,x]
[Out]
(Sqrt[a*(1 + Cos[c + d*x])]*Sec[(c + d*x)/2]*Sec[c + d*x]*(Sqrt[2]*ArcTanh[Sqrt[2]*Sin[(c + d*x)/2]]*Cos[c + d
*x] + 2*Sin[(c + d*x)/2]))/(2*d)
Maple [B] (verified)
Leaf count of result is larger than twice the leaf count of optimal. \(382\) vs. \(2(54)=108\).
Time = 1.22 (sec) , antiderivative size = 383, normalized size of antiderivative = 6.18
| | |
method | result | size |
| | |
default |
\(\frac {\cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (-2 a \left (\ln \left (\frac {4 \sqrt {2}\, a \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+4 \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}+8 a}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}}\right )+\ln \left (-\frac {4 \left (\sqrt {2}\, a \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}-2 a \right )}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}}\right )\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\ln \left (\frac {4 \sqrt {2}\, a \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+4 \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}+8 a}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}}\right ) a +\ln \left (-\frac {4 \left (\sqrt {2}\, a \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}-2 a \right )}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}}\right ) a +2 \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}\right )}{\sqrt {a}\, \left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}\right ) \left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, d}\) |
\(383\) |
| | |
|
|
|
[In]
int((a+cos(d*x+c)*a)^(1/2)*sec(d*x+c)^2,x,method=_RETURNVERBOSE)
[Out]
cos(1/2*d*x+1/2*c)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)*(-2*a*(ln(4/(2*cos(1/2*d*x+1/2*c)+2^(1/2))*(2^(1/2)*a*cos(1/
2*d*x+1/2*c)+2^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)*a^(1/2)+2*a))+ln(-4/(2*cos(1/2*d*x+1/2*c)-2^(1/2))*(2^(1/2
)*a*cos(1/2*d*x+1/2*c)-2^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)*a^(1/2)-2*a)))*sin(1/2*d*x+1/2*c)^2+ln(4/(2*cos(
1/2*d*x+1/2*c)+2^(1/2))*(2^(1/2)*a*cos(1/2*d*x+1/2*c)+2^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)*a^(1/2)+2*a))*a+l
n(-4/(2*cos(1/2*d*x+1/2*c)-2^(1/2))*(2^(1/2)*a*cos(1/2*d*x+1/2*c)-2^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)*a^(1/
2)-2*a))*a+2*2^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)*a^(1/2))/a^(1/2)/(2*cos(1/2*d*x+1/2*c)+2^(1/2))/(2*cos(1/2
*d*x+1/2*c)-2^(1/2))/sin(1/2*d*x+1/2*c)/(a*cos(1/2*d*x+1/2*c)^2)^(1/2)/d
Fricas [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 140 vs. \(2 (54) = 108\).
Time = 0.26 (sec) , antiderivative size = 140, normalized size of antiderivative = 2.26
\[
\int \sqrt {a+a \cos (c+d x)} \sec ^2(c+d x) \, dx=\frac {{\left (\cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \sqrt {a} \log \left (\frac {a \cos \left (d x + c\right )^{3} - 7 \, a \cos \left (d x + c\right )^{2} - 4 \, \sqrt {a \cos \left (d x + c\right ) + a} \sqrt {a} {\left (\cos \left (d x + c\right ) - 2\right )} \sin \left (d x + c\right ) + 8 \, a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2}}\right ) + 4 \, \sqrt {a \cos \left (d x + c\right ) + a} \sin \left (d x + c\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} + d \cos \left (d x + c\right )\right )}}
\]
[In]
integrate((a+a*cos(d*x+c))^(1/2)*sec(d*x+c)^2,x, algorithm="fricas")
[Out]
1/4*((cos(d*x + c)^2 + cos(d*x + c))*sqrt(a)*log((a*cos(d*x + c)^3 - 7*a*cos(d*x + c)^2 - 4*sqrt(a*cos(d*x + c
) + a)*sqrt(a)*(cos(d*x + c) - 2)*sin(d*x + c) + 8*a)/(cos(d*x + c)^3 + cos(d*x + c)^2)) + 4*sqrt(a*cos(d*x +
c) + a)*sin(d*x + c))/(d*cos(d*x + c)^2 + d*cos(d*x + c))
Sympy [F]
\[
\int \sqrt {a+a \cos (c+d x)} \sec ^2(c+d x) \, dx=\int \sqrt {a \left (\cos {\left (c + d x \right )} + 1\right )} \sec ^{2}{\left (c + d x \right )}\, dx
\]
[In]
integrate((a+a*cos(d*x+c))**(1/2)*sec(d*x+c)**2,x)
[Out]
Integral(sqrt(a*(cos(c + d*x) + 1))*sec(c + d*x)**2, x)
Maxima [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 1170 vs. \(2 (54) = 108\).
Time = 0.40 (sec) , antiderivative size = 1170, normalized size of antiderivative = 18.87
\[
\int \sqrt {a+a \cos (c+d x)} \sec ^2(c+d x) \, dx=\text {Too large to display}
\]
[In]
integrate((a+a*cos(d*x+c))^(1/2)*sec(d*x+c)^2,x, algorithm="maxima")
[Out]
-1/4*((4*sqrt(2)*sin(1/2*d*x + 1/2*c) - log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 + 2*sqrt(2)*co
s(1/2*d*x + 1/2*c) + 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2) + log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*
c)^2 + 2*sqrt(2)*cos(1/2*d*x + 1/2*c) - 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2) - log(2*cos(1/2*d*x + 1/2*c)^2 + 2
*sin(1/2*d*x + 1/2*c)^2 - 2*sqrt(2)*cos(1/2*d*x + 1/2*c) + 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2) + log(2*cos(1/2
*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 - 2*sqrt(2)*cos(1/2*d*x + 1/2*c) - 2*sqrt(2)*sin(1/2*d*x + 1/2*c) +
2))*cos(2*d*x + 2*c)^2 + (4*sqrt(2)*sin(1/2*d*x + 1/2*c) - log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2
*c)^2 + 2*sqrt(2)*cos(1/2*d*x + 1/2*c) + 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2) + log(2*cos(1/2*d*x + 1/2*c)^2 +
2*sin(1/2*d*x + 1/2*c)^2 + 2*sqrt(2)*cos(1/2*d*x + 1/2*c) - 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2) - log(2*cos(1/
2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 - 2*sqrt(2)*cos(1/2*d*x + 1/2*c) + 2*sqrt(2)*sin(1/2*d*x + 1/2*c)
+ 2) + log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 - 2*sqrt(2)*cos(1/2*d*x + 1/2*c) - 2*sqrt(2)*si
n(1/2*d*x + 1/2*c) + 2))*sin(2*d*x + 2*c)^2 + 4*sqrt(2)*cos(5/2*d*x + 5/2*c)*sin(2*d*x + 2*c) + 4*sqrt(2)*cos(
3/2*d*x + 3/2*c)*sin(2*d*x + 2*c) - 2*(2*sqrt(2)*sin(3/2*d*x + 3/2*c) - 4*sqrt(2)*sin(1/2*d*x + 1/2*c) + log(2
*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 + 2*sqrt(2)*cos(1/2*d*x + 1/2*c) + 2*sqrt(2)*sin(1/2*d*x +
1/2*c) + 2) - log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 + 2*sqrt(2)*cos(1/2*d*x + 1/2*c) - 2*sqr
t(2)*sin(1/2*d*x + 1/2*c) + 2) + log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 - 2*sqrt(2)*cos(1/2*d
*x + 1/2*c) + 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2) - log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 -
2*sqrt(2)*cos(1/2*d*x + 1/2*c) - 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2))*cos(2*d*x + 2*c) - 4*(sqrt(2)*cos(2*d*x
+ 2*c) + sqrt(2))*sin(5/2*d*x + 5/2*c) - 4*sqrt(2)*sin(3/2*d*x + 3/2*c) + 4*sqrt(2)*sin(1/2*d*x + 1/2*c) - log
(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 + 2*sqrt(2)*cos(1/2*d*x + 1/2*c) + 2*sqrt(2)*sin(1/2*d*x
+ 1/2*c) + 2) + log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 + 2*sqrt(2)*cos(1/2*d*x + 1/2*c) - 2*s
qrt(2)*sin(1/2*d*x + 1/2*c) + 2) - log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 - 2*sqrt(2)*cos(1/2
*d*x + 1/2*c) + 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2) + log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2
- 2*sqrt(2)*cos(1/2*d*x + 1/2*c) - 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2))*sqrt(a)/((cos(2*d*x + 2*c)^2 + sin(2*d
*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)*d)
Giac [A] (verification not implemented)
none
Time = 0.42 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.68
\[
\int \sqrt {a+a \cos (c+d x)} \sec ^2(c+d x) \, dx=-\frac {\sqrt {2} {\left (\sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 4 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}{{\left | 2 \, \sqrt {2} + 4 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}\right ) \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) + \frac {4 \, \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{2 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1}\right )} \sqrt {a}}{4 \, d}
\]
[In]
integrate((a+a*cos(d*x+c))^(1/2)*sec(d*x+c)^2,x, algorithm="giac")
[Out]
-1/4*sqrt(2)*(sqrt(2)*log(abs(-2*sqrt(2) + 4*sin(1/2*d*x + 1/2*c))/abs(2*sqrt(2) + 4*sin(1/2*d*x + 1/2*c)))*sg
n(cos(1/2*d*x + 1/2*c)) + 4*sgn(cos(1/2*d*x + 1/2*c))*sin(1/2*d*x + 1/2*c)/(2*sin(1/2*d*x + 1/2*c)^2 - 1))*sqr
t(a)/d
Mupad [F(-1)]
Timed out. \[
\int \sqrt {a+a \cos (c+d x)} \sec ^2(c+d x) \, dx=\int \frac {\sqrt {a+a\,\cos \left (c+d\,x\right )}}{{\cos \left (c+d\,x\right )}^2} \,d x
\]
[In]
int((a + a*cos(c + d*x))^(1/2)/cos(c + d*x)^2,x)
[Out]
int((a + a*cos(c + d*x))^(1/2)/cos(c + d*x)^2, x)